package com.mccrea.pattern.observer;

/**
 * @Classname Client
 * @Description 观察者模式测试
 * @Date 2021/5/21 0021 17:17
 * @Created by Mccrea_Gao
 */
public class Client {
    public static void main(String[] args) {
        Observer observer = new WeiXinUser("张三");
        Observer observer1 = new WeiXinUser("李四");
        Observer observer2 = new WeiXinUser("王五");
        Subject subject = new SubscriptSubject();
        subject.attach(observer);
        subject.attach(observer1);
        subject.attach(observer2);
        subject.notify("发布消息");
    }
}
